package com.sxhalo.fsms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sxhalo.fsms.domain.FactDeviceAlarmRule;
import com.sxhalo.fsms.mapper.FactDeviceAlarmRuleMapper;
import com.sxhalo.fsms.service.IFactDeviceAlarmRuleService;

@Service
public class FactDeviceAlarmRuleServiceImpl implements IFactDeviceAlarmRuleService {

	@Autowired
	private FactDeviceAlarmRuleMapper mapper;
	
	@Override
	public Integer insertSelective(FactDeviceAlarmRule record) {
		return mapper.insertSelective(record);
	}

	@Override
	public Integer updateByPrimaryKeySelective(FactDeviceAlarmRule record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public Integer deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FactDeviceAlarmRule selectByPrimaryKey(Object key) {
		return mapper.selectByPrimaryKey(Integer.parseInt(key.toString()));
	}

	@Override
	public List<FactDeviceAlarmRule> findWhereList(String where, String order) {
		// TODO Auto-generated method stub
		return mapper.findWhereList(where, order);
	}

	@Override
	public Integer getCount(String where) {
		// TODO Auto-generated method stub
		return mapper.getCount(where);
	}

	@Override
	public List<FactDeviceAlarmRule> findPagerList(Integer start, Integer length, String where, String order) {
		// TODO Auto-generated method stub
		return mapper.findPagerList(start, length, where, order);
	}
	
	@Override
	public Integer getMaxId() {
		return mapper.getMaxId();
	}

	@Override
	public int batchInsert(FactDeviceAlarmRule record, String[] ids) {
		// TODO Auto-generated method stub
		return mapper.batchInsert(record, ids);
	}


	@Override
	public FactDeviceAlarmRule findWhere(String where, String order) {
		List<FactDeviceAlarmRule>  rules= mapper.findWhereList(where, order);
		return rules.size()==0? null: rules.get(0);
	}

	@Override
	public int batchUpdate(FactDeviceAlarmRule record, String where) {
		return mapper.batchUpdate(record,where);
	}


}
